<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>window对象</title>
</head>
<body>
<button onclick="fn1()">alert</button>
<button onclick="fn2()">close</button>
<button onclick="fn3()">confirm</button>
<button onclick="fn4()">prompt</button>
</body>
<script>
    /**
     * alert方法
     */
    function fn1() {
        window.alert("删除用户成功");
    }

    /**
     * close方法
     */
    function fu2() {
    window.close();
    }

    /**
     * confirm方法
     */
    function fn3() {
        var confirm = window.confirm("确认删除该记录吗?");
        console.log(confirm ? "确认了" : "取消了");
    }

    /**
     * prompt方法
     */
    function fn4(){
        var result = window.prompt("请输入您的学号","123456");
        console.log("result=" + result);
    }
</script>
</html>